home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / c / qtools0.2-src.lha / src / libqbuild / portals.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-13  |  1.9 KB  |  77 lines

  1. #ifndef    PORTALS_H
  2. #define    PORTALS_H
  3. #include "winding.h"
  4.  
  5. /*
  6.  * ============================================================================
  7.  * structures
  8.  * ============================================================================
  9.  */
  10.  
  11. #define    PORTALFILE        "PRT1"
  12.  
  13. struct portal {
  14.   int planenum;
  15.   struct node *nodes[2];                    /* [0] = front side of planenum */
  16.   struct portal *next[2];
  17.   struct winding *winding;
  18. } __packed;
  19.  
  20. enum visstatus {
  21.   stat_none, stat_working, stat_done
  22. } __packed;
  23.  
  24. struct visportal {
  25.   struct plane plane;                        /* normal pointing into neighbor */
  26.   int leaf;                            /* neighbor */
  27.  
  28.   struct winding *winding;
  29.   enum visstatus status;
  30.   unsigned char *visbits;
  31.   unsigned char *mightsee;
  32.   int nummightsee;
  33.   int numcansee;
  34. } __packed;
  35.  
  36. struct seperatingplane {
  37.   struct seperatingplane *next;
  38.   struct plane plane;                        /* from portal is on positive side */
  39. } __packed;
  40.  
  41. struct passage {
  42.   struct passage *next;
  43.   int from, to;                            /* leaf numbers */
  44.   struct seperatingplane *planes;
  45. } __packed;
  46.  
  47. struct visleaf {
  48.   struct passage *passages;
  49.   int numportals;
  50.   struct visportal **portals;                    /*[MAX_PORTALS_ON_LEAF]; */
  51. } __packed;
  52.  
  53. /*
  54.  * ============================================================================
  55.  * globals
  56.  * ============================================================================
  57.  */
  58.  
  59. extern struct node outside_node;                /* portals outside the world face this */
  60. extern int num_visleafs;                    /* leafs the player can be in */
  61. extern int num_visportals;
  62. extern struct visportal *portals;
  63. extern struct visleaf **leafs;
  64.  
  65. /*
  66.  * ============================================================================
  67.  * prototypes
  68.  * ============================================================================
  69.  */
  70.  
  71. void PortalizeWorld(__memBase, struct node *headnode);
  72. void FreeAllPortals(struct node *node);
  73. void WritePortalfile(__memBase, struct node *headnode, char *portfilename);
  74. void LoadPortals(char *prtBuf);
  75.  
  76. #endif
  77.